home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / sml_nj / 93src.lha / src / runtime / mask.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-02-09  |  1.5 KB  |  75 lines

  1. /* mask.h 
  2.  *
  3.  * COPYRIGHT (c) 1990 by AT&T Bell Laboratories.
  4.  *
  5.  * CALLEESAVE = 1 case is avoided, this is consistant with the 
  6.  * the code in cps directory(closure.sml generic.sml etc)
  7.  *
  8.  * Some assemblers don't like <<.
  9.  * The dynix3 assembler doesn't like parentheses.
  10.  */
  11.  
  12. #ifdef CALLEESAVE
  13. #if defined(M68) || defined(VAX)
  14. #define PWR_2_CALLEESAVE 1
  15. #else 
  16. #define PWR_2_CALLEESAVE (1<<(CALLEESAVE))
  17. #endif
  18. #else
  19. #if defined(SPARC) || defined(MIPS) || defined(RS6000) || defined(HPPA)
  20. #define CALLEESAVE 3
  21. #define PWR_2_CALLEESAVE 8
  22. #else
  23. #define CALLEESAVE 0
  24. #define PWR_2_CALLEESAVE 1
  25. #endif
  26. #endif
  27.  
  28. #ifndef HPPA_ASM_HACK
  29. # ifdef HPPA
  30. #  define HPPA_ASM_HACK 0+
  31. # else
  32. #  define HPPA_ASM_HACK
  33. # endif
  34. #endif
  35.  
  36.  
  37.  
  38.                 /* ((1 << (CALLEESAVE + 4)) - 1) */
  39. #if defined(DYNIX) && defined(ASM)
  40. #define closmask [[PWR_2_CALLEESAVE * 16] - 1]    
  41. #else
  42. #define closmask HPPA_ASM_HACK((PWR_2_CALLEESAVE * 16) - 1)    
  43. #endif
  44.  
  45. /*
  46.  * We avoid saying:
  47.  *    if (CALLEESAVE == 0) ..
  48.  * since this gives cpp running on HPUX trouble.
  49.  */
  50. #if CALLEESAVE
  51.                 /* ((1 << (CALLEESAVE + 4)) - 0x10 + 0xc) */
  52.  
  53. #if defined(DYNIX) && defined(ASM)
  54. #define contmask [[PWR_2_CALLEESAVE * 16] - 0x10 + 0xc]
  55. #else
  56. #define contmask HPPA_ASM_HACK((PWR_2_CALLEESAVE * 16) - 0x10 + 0xc)
  57. #endif
  58. #define exnmask closmask
  59.  
  60. #else
  61.  
  62. #if defined(DYNIX) && defined(ASM)
  63. #define contmask [0xd]
  64. #else
  65. #define contmask HPPA_ASM_HACK(0xd)
  66. #endif
  67. #define exnmask contmask
  68. #endif
  69.  
  70. #if CALLEESAVE
  71. #define callcc_mask closmask
  72. #else
  73. #define callcc_mask contmask
  74. #endif
  75.